package com.marquis.cloud.client;

import com.marquis.cloud.entity.AutUser;
import com.marquis.cloud.fallBack.AutUserFallBack;
import com.marquis.cloud.pagequery.PaginationGrid;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Feign客户端
 * cloud-providerr: 待请求的服务ID
 */
@FeignClient(name = "cloud-provider", fallback = AutUserFallBack.class)
public interface AutUserClient {

    /**
     * 用户信息分页查询
     * 注意: method、@RequestParam必须声明
     * @return
     */
    @RequestMapping(value = "/aut/user/queryUserPage", method = RequestMethod.POST)
    PaginationGrid<AutUser> queryUserPage(@RequestParam("page") Integer page, @RequestParam("pageSize") Integer pageSize);

    /**
     * 根据用户名查询用户信息
     * @param userName 用户名
     * @return
     */
    @RequestMapping(value = "/aut/user/findByUserName", method = RequestMethod.POST)
    AutUser findByUserName(@RequestParam("userName") String userName);
}
